"""
@Author    : ghenyar
@Time      : 2025/9/18 15:53
@File      : order
@Desc      : 
"""
from celery import shared_task

from app.celerys import celery_app
from app.core.db import get_db_session


@celery_app.task(name="order.cancel_unpaid")
def cancel_unpaid(order_id: int):
    print("cancel_unpaid：订单自动取消")
    # with get_db_session() as db:
    #     order = db.query(Order).get(order_id)
    #     if order and order.status == "unpaid":
    #         order.status = "cancelled"

